Srcs := $(wildcard *.c)
Objs := $(patsubst %.c, %.o, $(Srcs))
Out := main

CC := gcc
CFLAGS := -Wall -g

$(Out): $(Objs)
	$(CC) $^ -o $@

%.o: %.c algs.h
	$(CC) -c $< $(CFLAGS)

.PHONY: clean rebuild print

print:
	echo $(Objs)
clean:
	$(RM) $(Objs)
rebuild: clean $(Out)
